package org.apache.ocean.name;

import java.net.URL;
import java.util.Date;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.ocean.CElement;
import org.apache.ocean.TransactionID;
import org.apache.ocean.XMLUtil;
import org.jdom.Element;

/**
 *
 * @author jasonr
 */
public class NameInfo implements CElement {
  public String id;
  public String masterNameID;
  public TransactionID highestReplicationIDDatabase;
  public URL url;
  public Date startDate;
  
  public NameInfo() {}
  
  public String toString() {
    return ReflectionToStringBuilder.toString(this);
  }
  
  public NameInfo(Element element) throws Exception {
    XMLUtil.reflectToObject(this, element);
  }
  
  public Element toElement() throws Exception {
    return XMLUtil.reflectToElement("nameinfo", this);
  }
}
